<script setup lang='ts'>
import { ref } from "vue";
// const value = defineModel({default: 0})
const props = defineProps(['color'])
let value = ref(0);
const onMines = () => {
  if (value.value > 0) {
    value.value -= 1
  }
}
</script>

<template>
  <view class="main" :style="{ color: color || '#000' }">
    <uni-icons :color="color || '#000'" class="icon" type="minus" size="30" @click="onMines"></uni-icons>
    <span>{{ value }}</span>
    <uni-icons :color="color || '#000'" class="icon" type="plus" size="30" @click="value += 1"></uni-icons>
  </view>
</template>

<style scoped lang='scss'>
.main {
  display: flex;
  align-items: center;
  .icon {
  }
  span {
    margin: 0 12rpx;
    text-align: center;
    display: inline-block;
  }
}
</style>